<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>load.html</title>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
	<script type="text/javascript" src="jquery-1.6.js"></script>
  	<script type="text/javascript">
  		var url="testXML.jsp";
  		function getXML(){
  	  		var showXml=$("#xml");
			$.post(url,null,function(data){

				var dataXml=$(data);
				var dataItem=dataXml.find("book");
				showXml.html("");
//alert(dataItem.length);
				dataItem.each(function(){
					var $book=$(this);
					var b=$book.attr("bookNO")+"---"+$book.find("bookName").text()+"---"+$book.find("price").text();
				//	alert($book.attr("bookNO"));
					var odiv=$("<div>");
					odiv.css("background","#ddd").css("height","30px")
					.css("margin-top","2px").css("border","1px solid red");
					odiv.html(b);

					showXml.append(odiv);
				});
			});
  	 	}
  	</script>
  </head>
  
  <body>
  <button onclick="getXML();">getXML</button>
  <hr>
  	<div id="xml" style="border:1px solid red;width:300px;height:400px;"></div>
  </body>
</html>
